<template>
    <div v-for="item in arr" :key="item">{{ item }}遍历的的就是div本身</div>
    
    <div v-for="v in arr"  :key="v">{{ item }}item的名字不是固定的</div>
     

    <div v-for="item in arr2" :key="item">
        <p>{{ item.title }}</p>
         <!-- 设置src的属性要v-bind-src:"v.avator" -->
        <img :src="item.avator">
    </div>


    <div v-for="(item, index) of arr2" :key="index">{{ item.title }}，{{index}}</div>

    <div v-for="item in obj" :key="item">{{ item }}遍历对象</div>
    <div v-for="(v,k,index) in obj" :key="index">{{ item }}遍历对象</div>
</template>
v
<script>
export default {
    data(){
        return{
            arr:['a','b','caaa'],
            arr2:[
                {"id":1,"title":'t1',"avator":'http1'},
                {"id":2,"title":'t2',"avator":'http2'},
                {"id":3,"title":'t3',"avator":'http3'}
            ],
            obj:{"id":1,"title":'t1',"avator":'http1'}
        }
    }
}
</script>
